{extend name="layout/detail" /}

{block name="content"}
<input type="hidden" name="ajax" id="ajax" value="1">
<div class="td-content-wrap p20">
    <div class="td-content-header">
        <h1 class="main-title">字段编辑</h1>
    </div>
    <hr>
    <div class="space-20"></div>
    <form id="form_data" class="layui-form" method="post" action="{:url('save')}">
        <input type="hidden" name="opmode" value="edit">
        <input type="hidden" name="id" value="{$vo.id}">
        <div class="layui-form-item">
            <label class="layui-form-label required">表名：</label>
            <div class="layui-input-block w40">
                <div class="layui-form-mid">{:request()->param('table')}</div>
            </div>
        </div>
        <hr>

        <hr>
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <div class="layui-input-block">
                <a class="layui-btn" onclick="save();">保存</a>
                <a class="layui-btn layui-btn-primary" onclick="go_return_url();">取消</a>
            </div>
        </div>
    </form>
</div>
{/block}

{block name="script"}
<script>
    layui.use(['common', 'form', 'ueditor', 'uploader'], function () {
        let $ = layui.jquery;
        let fn = {
            select_category: function () {
                popup_open("{:url('select_category')}", 560, 470);
            },
            save: function () {
                send_form("form_data", "{:url('save')}", function (ret) {
                    if (ret.code) {
                        layer.msg(ret.msg, {
                            time: 1200
                        }, function () {
                            location.href = "{:url('index')}";
                        });
                    } else {
                        layer.msg(ret.msg);
                        return false;
                    }
                });
            }
        };
        win_exp(fn);

    });
</script>
{/block}
